home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7176 < prev    next >
Encoding:
Text File  |  1996-08-05  |  943 b   |  56 lines

  1. Path: ix.netcom.com!netnews
  2. From: wells2@ix.netcom.com (wells)
  3. Newsgroups: comp.lang.c++
  4. Subject: emergency! need help with this now. please.
  5. Date: Thu, 22 Feb 1996 03:35:27 GMT
  6. Organization: Netcom
  7. Message-ID: <4ggqna$571@ixnews6.ix.netcom.com>
  8. NNTP-Posting-Host: irv-ca9-08.ix.netcom.com
  9. X-NETCOM-Date: Wed Feb 21  8:16:42 PM PST 1996
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12.  
  13.  
  14. why doesnt this work???? I need it for my class tommorow.
  15.  
  16. help please ,  thanks    edward
  17.  
  18.  
  19.  
  20. #include <stdio.h>
  21. #include <iostream.h>
  22. #include <math.h>
  23.  
  24. void main(void)
  25.  
  26. {
  27.  
  28.     float l;    // loan amount
  29.     float r;    // interest rate
  30.     int n;        // number of payments
  31.     float p;    // payment
  32.     float a,b,c,d;
  33.     
  34.     cout << "Enter the full loan amount ->";
  35.     cin >> l;
  36.     cout << "\n Enter the interest rate ->";
  37.     cin >> r;
  38.     cout << "\n Enter the number of payments ->";
  39.     cin >> n;
  40.     
  41.     r=r/1200;    
  42.     
  43.     a=(l+r);
  44.     b=pow(a,n)*r;
  45.     
  46.     c=(l+r);
  47.     d=pow(c,n)-1;
  48.     p=((b/d)*l);
  49.     
  50.     cout << p;
  51.     
  52.     }
  53.     
  54.  
  55.  
  56.